//得到Cookie 读取Cookie
function getCookie(key){
	var cValue = document.cookie.split("; ");
	var result = "";
	for(var i = 0;i < cValue.length;i++){
		var cItem = cValue[i].split("=");
		if(cItem[0] == key){
			result = cItem[1];
			break;
		}
	}
	return result;
}
//写入cookie
function setCookie(key,value,expires){
	var cValue = key + "=" + value;
	if(expires){
		cValue += ";expires=" + expires;
	}
	document.cookie = cValue;
}
//删除cookie
function delCookie(key){
	document.cookie = key + "=" + ";expires=" + new Date(0);
}